*** 8250_pci.c	2006-05-11 02:56:24.000000000 +0100
--- tainted_8250_pci.c	2007-10-18 10:17:06.000000000 +0100
***************
*** 903,908 ****
--- 903,910 ----
  	pbn_b0_4_1843200_200,
  	pbn_b0_8_1843200_200,
  
+     pbn_b0_1_4000000,
+ 
  	pbn_b0_bt_1_115200,
  	pbn_b0_bt_2_115200,
  	pbn_b0_bt_8_115200,
***************
*** 967,972 ****
--- 969,978 ----
  	pbn_exsys_4055,
  	pbn_plx_romulus,
  	pbn_oxsemi,
+     pbn_oxsemi_1_4000000,
+     pbn_oxsemi_2_4000000,
+     pbn_oxsemi_4_4000000,
+     pbn_oxsemi_8_4000000,
  	pbn_intel_i960,
  	pbn_sgi_ioc3,
  	pbn_nec_nile4,
***************
*** 1085,1090 ****
--- 1091,1102 ----
  		.base_baud	= 1843200,
  		.uart_offset	= 0x200,
  	},
+ 	[pbn_b0_1_4000000] = {
+ 		.flags		= FL_BASE0,
+ 		.num_ports	= 1,
+ 		.base_baud	= 4000000,
+ 		.uart_offset	= 8,
+ 	},
  
  	[pbn_b0_bt_1_115200] = {
  		.flags		= FL_BASE0|FL_BASE_BARS,
***************
*** 1401,1406 ****
--- 1413,1447 ----
  		.base_baud	= 115200,
  		.uart_offset	= 8,
  	},
+ 	[pbn_oxsemi_1_4000000] = {
+ 		.flags		= FL_BASE0,
+ 		.num_ports	= 1,
+ 		.base_baud	= 4000000,
+ 		.uart_offset    = 0x200,
+         .first_offset   = 0x1000,
+ 	},
+ 	[pbn_oxsemi_2_4000000] = {
+ 		.flags		= FL_BASE0,
+ 		.num_ports	= 2,
+ 		.base_baud	= 4000000,
+ 		.uart_offset    = 0x200,
+         .first_offset   = 0x1000,
+ 	},
+ 	[pbn_oxsemi_4_4000000] = {
+ 		.flags		= FL_BASE0,
+ 		.num_ports	= 4,
+ 		.base_baud	= 4000000,
+ 		.uart_offset    = 0x200,
+         .first_offset   = 0x1000,
+ 	},
+ 	[pbn_oxsemi_8_4000000] = {
+ 		.flags		= FL_BASE0,
+ 		.num_ports	= 8,
+ 		.base_baud	= 4000000,
+ 		.uart_offset    = 0x200,
+         .first_offset   = 0x1000,
+ 	},
+ 
  
  	/*
  	 * EKF addition for i960 Boards form EKF with serial port.
***************
*** 1576,1581 ****
--- 1617,1656 ----
  	    board->first_offset == guessed->first_offset;
  }
  
+ /*
+  * Oxford Semiconductor Inc.
+  * Check that device is part of the Tornado range of devices, then determine
+  * the number of ports available on the device.
+  */
+ static int pci_oxsemi_tornado_init(struct pci_dev *dev, struct pciserial_board *board)
+ {
+ 	u8 __iomem *p;
+     unsigned long deviceID;
+     unsigned int  number_uarts;
+     
+ 	p = ioremap(pci_resource_start(dev, 0),pci_resource_len(dev,0));
+ 
+ 	if (p == NULL)
+     {
+ 		return -ENOMEM;
+     }
+     
+     deviceID = ioread32(p);
+     if (deviceID != 0x07000200)
+     {
+         // Not a Tornado device
+         iounmap(p);
+         return 0;
+     }
+     
+     number_uarts = ioread8(p + 0x0004);
+     board->num_ports = number_uarts;
+     printk("%d ports detected on Oxford PCI Express device\n", number_uarts);
+     
+ 	iounmap(p);
+ 	return 0;
+ }
+ 
  struct serial_private *
  pciserial_init_ports(struct pci_dev *dev, struct pciserial_board *board)
  {
***************
*** 1584,1589 ****
--- 1659,1672 ----
  	struct pci_serial_quirk *quirk;
  	int rc, nr_ports, i;
  
+     /*
+      * Find number of ports on board
+      */
+     if (dev->vendor == PCI_VENDOR_ID_OXSEMI)
+     {
+         pci_oxsemi_tornado_init(dev, board);
+     }
+     
  	nr_ports = board->num_ports;
  
  	/*
***************
*** 2052,2057 ****
--- 2135,2276 ----
  		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
  		pbn_b0_bt_2_921600 },
  
+     /*
+      * Oxford Semiconductor Inc. Tornado PCI express device range.
+      */
+  	{	PCI_VENDOR_ID_OXSEMI, 0xc101,    // OXPCIe952 1 Legacy UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_b0_1_4000000 },
+  	{	PCI_VENDOR_ID_OXSEMI, 0xc105,    // OXPCIe952 1 Legacy UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_b0_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc11b,    // OXPCIe952 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc11f,    // OXPCIe952 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+  	{	PCI_VENDOR_ID_OXSEMI, 0xc120,    // OXPCIe952 1 Legacy UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_b0_1_4000000 },
+  	{	PCI_VENDOR_ID_OXSEMI, 0xc124,    // OXPCIe952 1 Legacy UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_b0_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc138,    // OXPCIe952 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc13d,    // OXPCIe952 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc140,    // OXPCIe952 1 Legacy UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_b0_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc141,    // OXPCIe952 1 Legacy UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_b0_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc144,    // OXPCIe952 1 Legacy UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_b0_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc145,    // OXPCIe952 1 Legacy UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_b0_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc158,    // OXPCIe952 2 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_2_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc15d,    // OXPCIe952 2 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_2_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc208,    // OXPCIe954 4 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_4_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc20d,    // OXPCIe954 4 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_4_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc308,    // OXPCIe958 8 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_8_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc30d,    // OXPCIe958 8 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_8_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc40b,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc40f,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc41b,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc41f,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc42b,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc42f,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc43b,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc43f,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc44b,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc44f,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc45b,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc45f,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc46b,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc46f,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc47b,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc47f,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc48b,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc48f,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc49b,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc49f,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc4ab,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc4af,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc4bb,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc4bf,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc4cb,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 	{	PCI_VENDOR_ID_OXSEMI, 0xc4cf,    // OXPCIe200 1 Native UART
+ 		PCI_ANY_ID, PCI_ANY_ID, 0, 0,
+ 		pbn_oxsemi_1_4000000 },
+ 
  	/*
  	 * SBS Technologies, Inc. P-Octal and PMC-OCTPRO cards,
  	 * from skokodyn@yahoo.com
